package com.googlecode.dgwt.client.dojo.data.base;

import java.util.Collection;

import com.googlecode.dgwt.client.dojo.data.model.TableColumn;
import com.googlecode.dgwt.client.dojo.data.model.TableModel;

/**
 * @author wellsantos@wellsantos.com
 * @since 0.01
 */
public abstract class TableStoreBase<Item,Model extends TableModel<Item,Column>,Column extends TableColumn<Item, ?>> extends ModeledStoreBase<Item,Model,Column> implements TableStore<Item> {

    
    protected TableStoreBase() {
        super();
    }

    protected TableStoreBase(Collection<? extends Item> items) {
        super(items);
    }

    protected TableStoreBase(int initialCapacity) {
        super(initialCapacity);
    }

    protected TableStoreBase(TableStoreBase<Item,Model,Column> mirroredStore, Model newModel) {
        super(mirroredStore, newModel);
    }
    
    
    public TableStoreBase(Model model, Collection<? extends Item> items) {
        super(model, items);
    }

    public TableStoreBase(Model model, int initialCapacity) {
        super(model, initialCapacity);
    }

    public TableStoreBase(Model model) {
        super(model);
    }

    @Override
    public String getColumnTitle(int columnIndex) {
        return getModel().getColumns().get(columnIndex).getTitle();
    }

    @Override
    public void refreshValue(int rowIndex, int columnIndex) {
        super.refreshValue(get(rowIndex), columnIndex);
    }

    @Override
    public String getColumnWidth(int columnIndex) {
        return getModel().getColumns().get(columnIndex).getWidth();
    }

}
